//存放所有关于用户的接口
import request from "@/utils/request";

//调试代理是否成功
// request.get('/user/checkname', {
//     params: {
//         username: 'malin'
//     }
// })

export default {
	//功能：获取购物车信息
	getAllcartlist(page, pagesize, goodsId, username) {
		return request.get("/ordersRouter/getAllcartlist", {
			params: { page, pagesize, goodsId, username },
		});
	},
	//增加订单
	addGoods(goodsId, username, num) {
		return request.post("/ordersRouter/addGoods", {
			goodsId,
			username,
			num,
		});
	},

	setGoods(goodsId, num, username, cid) {
		return request.put("/ordersRouter/setGoods", {
			goodsId,
			num,
			username,
			cid,
		});
	},
	//删除商品
	deleteGoods(cid) {
		return request({
			method: "delete",
			url: "/ordersRouter/deleteGoods",
			data: {
				cid,
			},
		});
	},
};
